<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitMaket extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('market_tenants', function (Blueprint $table) {
            $table->comment = '交易市场商户';

            $table->increments('id');
            $table->uuid('uuid')->index() ;

            $table->integer('user_id')->index()->comment('用户id');

            $table->string('title')->nullable()->comment('标题');

            $table->integer('score_total')->index()->default(0)->comment('交易积分金额');
            $table->integer('money_total')->index()->default(0)->comment('交易人民币金额');
            $table->integer('product_total')->index()->default(0)->comment('交易商品数');

            $table->softDeletes();
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('market_tenants');
    }
}
